<?php
namespace app\common\model;
use think\Model;

class DataContentChip extends Model
{
    public function getDataByPosition($position1, $limit){
        $data = $this->where([
            'position1' => $position1
        ])->field('title')->orderRand()->limit($limit)->select();
        return $data;
    }

    public function getDataByPositionOne($position1, $position2){
        $data = $this->where([
            'position1' => $position1,
            'position2' => $position2
        ])->field('title')->orderRand()->find();
        return $data;
    }
}